{% from "helpers.html" import input %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN">
	<head>
		<link rel="shortcut icon" href="/static/favicon.ico" />
		<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='bootstrap.css') }}">
		<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='responsive.css') }}">
		<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='pygments.css') }}">
		<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
		<title>zwiki</title>
	</head>

	<body>
		<div class="navbar navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container">
					<div class="row">
						<div class="span12">
							<a href="#" class="brand">{{ config.TITLE }}</a>
							<ul class="nav">
								<li><a href="{{ url_for('home') }}">Home</a></li>
								<li><a href="{{ url_for('index') }}">Index</a></li>
								<li><a href="{{ url_for('tags') }}">Tags</a></li>
								<li><a href="{{ url_for('search') }}">Search</a></li>
								<li class="divider-vertical"></li>
								<li><a href="{{ url_for('create') }}">New Page</a></li>
								<li class="divider-vertical"></li>
								<li></li>
							</ul>

							<ul class="nav pull-right">
								{% if current_user.is_anonymous() %}
									<li><a href="{{ url_for('user_login') }}">Login</a></li>
								{% else %}
									<li><a href="#">Welcome {{ current_user.name }}!</a></li>
									<li><a href="{{ url_for('user_logout') }}">Logout</a></li>
								{% endif %}
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="container">
			<div class="row">
				<div class="span10 offset1">
					{% block header %}
						<div class="page-header">
							<h1>{% block title %}{{ page.title }}{% endblock title %}</h1>
						</div>
					{% endblock header %}
				</div>
			</div>
			<div class="row">
				<div class="span7 offset1">
					{% with messages = get_flashed_messages(with_categories=True) %}
						{% if messages %}
							{% for category, message in messages %}
								<div class="alert alert-{{ category }}">
									<button type="button" class="close" data-dismiss="alert">&times;</button>
									{{ message }}
								</div>
							{% endfor %}
						{% endif %}
					{% endwith %}
					{% if form and form.errors %}
						<div class="alert alert-error">Errors occured verifying your input. Please check the marked fields below.</div>
					{% endif %}
					{% block content %}
					{% endblock content %}
				</div>
				<div class="span3">
					{% block sidebar %}
					{% endblock sidebar %}
				</div>
			</div>
		</div>
		<div class="footer container">
 			<!--高速版，加载速度快，使用前需测试页面的兼容性-->
			<div class="SOHUCS" id="SOHUCS"></div>
			<script>
			  (function(){
			    var appid = '{{ config.SOHUCS_APPID }}',
			    conf = '{{ config.SOHUCS_CONF }}';
			    var doc = document,
			    s = doc.createElement('script'),
			    h = doc.getElementsByTagName('head')[0] || doc.head || doc.documentElement;
			    s.type = 'text/javascript';
			    s.charset = 'utf-8';
			    s.src =  'http://assets.changyan.sohu.com/upload/changyan.js?conf='+ conf +'&appid=' + appid;
			    h.insertBefore(s,h.firstChild);
			    window.SCS_NO_IFRAME = true;
			  })()
			</script>    
	        <br/> 
		</div>
		<script type="text/javascript" src="{{ url_for('static', filename='jquery.min.js') }}"></script>
		<script type="text/javascript" src="{{ url_for('static', filename='ajaxfileupload.js') }}"></script>
		<script type="text/javascript" src="{{ url_for('static', filename='bootstrap.min.js') }}"></script>
		<script type="text/javascript">
			{% block postscripts %}
			{% endblock postscripts %}
		</script>
	</body>
</html>
